package com.duo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.duo.dto.OrdersConfirmDTO;
import com.duo.dto.OrdersPageQueryDTO;
import com.duo.dto.OrdersPaymentDTO;
import com.duo.dto.OrdersSubmitDTO;
import com.duo.entity.Orders;
import com.duo.entity.User;
import com.duo.result.PageResult;
import com.duo.vo.OrderDetailVO;
import com.duo.vo.OrderSubmitVO;

/**
 * @Author: Xrx
 * @Description:
 * @CreateTime: 2023/7/8 19:25
 */
public interface OrderService extends IService<Orders> {

    /**
     * 用户下单
     * @param ordersSubmitDTO
     * @return
     */
    OrderSubmitVO submitOrder(OrdersSubmitDTO ordersSubmitDTO, User user);

    /**
     * 订单支付
     * @param ordersPaymentDTO
     * @return
     */
    Orders payment(OrdersPaymentDTO ordersPaymentDTO, User user);

    /**
     * 历史订单查询
     * @param ordersPageQueryDTO
     * @return
     */
    PageResult pageQuery4User(OrdersPageQueryDTO ordersPageQueryDTO, User user);

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    OrderDetailVO details(Long id);

    /**
     * 用户取消订单
     * @param id
     */
    void userCancelById(Long id) throws Exception;

    /**
     * 用户催单
     * @param id
     */
    void reminder(Long id);

    /**
     * 商家接受订单
     * @param ordersConfirmDTO
     */
    void confirm(OrdersConfirmDTO ordersConfirmDTO);

    /**
     * 商家完成订单
     * @param id
     */
    void complete(Long id);

    /**
     * 来单提醒
     * @param outTradeNo
     */
    void paySuccess(String outTradeNo, Long userId);


}
